//
//  LessonDetail.swift
//  LeGou
//
//  Created by lxm on 2022/10/13.
//

import UIKit

class LessonDetailView: XMBaseView {

    //MARK: --------------------属性--------------------
    var downloadLink = ""
    var password = ""
    //MARK: --------------------UI控件--------------------
    @IBOutlet weak var contentLabel: UILabel!
    //MARK: --------------------生命周期--------------------
    override init(frame: CGRect) {
        super.init(frame: frame)
        setUI()
        bindAction()
        addConstraints()
    }
    
    required init?(coder: NSCoder) {
        super.init(coder: coder)
    }
    
    override func awakeFromNib() {
        super.awakeFromNib()
        setUI()
        bindAction()
        addConstraints()
    }

    //MARK: --------------------UI--------------------
    func setUI() {
 
    }
    
    func addConstraints() {
     
    }
    
    //MARK: --------------------methods--------------------
    func bindAction() {
        
    }
    
    func resetUI() {
        let text = "下载链接：\(downloadLink)\n\n下载密码：\(password)"
        contentLabel.text = text
    }
    
    @IBAction func onClose(_ sender: Any) {
        removeFromSuperview()
    }
    
    
    @IBAction func onCopy(_ sender: Any) {
        let text = "链接:\(downloadLink)\n密码:\(password)"
        UIPasteboard.general.string = text
        ZMToast.showToast(title: "已经复制到粘贴板")
    }
    
    
    @IBAction func onContact(_ sender: Any) {
        removeFromSuperview()
        CommonService.shared.showContactService()
    }
    
    //MARK: --------------------delegate--------------------

}
